var path = require('path');

const VueLoaderPlugin = require('vue-loader/lib/plugin');

module.exports = {
    
    entry: path.join(__dirname, './src/main.js'),
    output: {
        path: path.join(__dirname, './dist'),
        filename: 'main.js'
    },
    plugins: [
        // make sure to include the plugin for the magic
        new VueLoaderPlugin()
    ],
    module: {
        rules: [
            { test: /\.css$/, use: [ 'style-loader', 'css-loader']},
            { test: /\.less$/, use: ['style-loader', 'css-loader', 'less-loader']},
            { test: /\.scss$/, use: ['style-loader', 'css-loader', 'sass-loader']},
            { test: /\.(jpg|png|gif|bmp|jpeg)$/, use: [{ loader: 'file-loader', options: {publicPath: '../dist'}}]},
            { test: /\.(ttf|eot|svg|woff|woff2)$/, use: [{ loader: 'file-loader', options: {publicPath: '../dist'}}]}, //一定要注意文件路径文件    找了好久  字体文件引入不了 就是路径出错了
            { test: /\.js$/, use: 'babel-loader', exclude: /node_modules/},
            { test: /\.vue$/, use: 'vue-loader'}
        ]
    },
    resolve: {
        alias: {  //修改 vue 被导入时候的路径
            "vue$": "vue/dist/vue.js"
        }
    }
}